﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;

public class LevelBalloon : MonoBehaviour
{
    public Text loveText;
    public Button loveButton;
    public GameLevelItem gameLevelItem;
    private bool move = false;

    private void Start()
    {
        loveButton.onClick.AddListener(() =>
        {
            loveText.color = Color.black;
            gameLevelItem.TriggerResult(true);
        });
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (!move)
        {
            SoundManager.Instance.PlayAudio(SoundType.Fall.ToString(), false);
            collision.transform.parent = this.transform;
            this.transform.DOLocalMoveY(this.transform.localPosition.y - 400, 3.2f);
            move = true;
        }
    }




}
